欢迎来到路由器窝!

DEDE使用默认评论

浏览次数:

作者: 路由器窝

信息来源:

更新日期: 2017-05-23 01:03

文章简介

将默认模板文件ajaxfeedback2.htm更改成ajaxfeedback.htm放到模板目录下面 文件下载 在文章模板head下加入以下代码 link href={dede:global.cfg_templets_skin/}/style/dede

  • 正文开始
  • 相关文章
将默认模板文件ajaxfeedback2.htm更改成ajaxfeedback.htm放到模板目录下面   文件下载

在文章模板head下加入以下代码
<link href="{dede:global.cfg_templets_skin/}/style/dedecms.css" rel="stylesheet" media="screen" type="text/css" />
<script language="javascript" type="text/javascript" src="{dede:global.cfg_cmsurl/}/include/dedeajax2.js"></script>

<script language="javascript" type="text/javascript">
<!--
function CheckLogin(){
	  var taget_obj = document.getElementById('_ajax_feedback');
	  myajax = new DedeAjax(taget_obj,false,false,'','','');
	  myajax.SendGet2("{dede:global.cfg_cmsurl/}/member/ajax_feedback.php");
	  DedeXHTTP = null;
}
function postBadGood(ftype,fid)
{
	var taget_obj = document.getElementById(ftype+fid);
	var saveid = GetCookie('badgoodid');
	if(saveid != null)
	{
		var saveids = saveid.split(',');
		var hasid = false;
		saveid = '';
		j = 1;
		for(i=saveids.length-1;i>=0;i--)
		{
			if(saveids[i]==fid && hasid) continue;
			else {
				if(saveids[i]==fid && !hasid) hasid = true;
				saveid += (saveid=='' ? saveids[i] : ','+saveids[i]);
				j++;
				if(j==10 && hasid) break;
				if(j==9 && !hasid) break;
			}
		}
		if(hasid) { alert('您刚才已表决过了喔!'); return false;}
		else saveid += ','+fid;
		SetCookie('badgoodid',saveid,1);
	}
	else
	{
		SetCookie('badgoodid',fid,1);
	}
	myajax = new DedeAjax(taget_obj,false,false,'','','');
	myajax.SendGet2("{dede:field name='phpurl'/}/feedback.php?aid="+fid+"&action="+ftype+"&fid="+fid);
}
function postDigg(ftype,aid)
{
	var taget_obj = document.getElementById('newdigg');
	var saveid = GetCookie('diggid');
	if(saveid != null)
	{
		var saveids = saveid.split(',');
		var hasid = false;
		saveid = '';
		j = 1;
		for(i=saveids.length-1;i>=0;i--)
		{
			if(saveids[i]==aid && hasid) continue;
			else {
				if(saveids[i]==aid && !hasid) hasid = true;
				saveid += (saveid=='' ? saveids[i] : ','+saveids[i]);
				j++;
				if(j==20 && hasid) break;
				if(j==19 && !hasid) break;
			}
		}
		if(hasid) { alert("您已经顶过该帖,请不要重复顶帖 !"); return; }
		else saveid += ','+aid;
		SetCookie('diggid',saveid,1);
	}
	else
	{
		SetCookie('diggid',aid,1);
	}
	myajax = new DedeAjax(taget_obj,false,false,'','','');
	var url = "{dede:global.cfg_phpurl/}/digg_ajax.php?action="+ftype+"&id="+aid;
	myajax.SendGet2(url);
}
function getDigg(aid)
{
	var taget_obj = document.getElementById('newdigg');
	myajax = new DedeAjax(taget_obj,false,false,'','','');
	myajax.SendGet2("{dede:global.cfg_phpurl/}/digg_ajax.php?id="+aid);
	DedeXHTTP = null;
}
-->
</script>

相应位置猜一下代码
  <!-- //顶踩 -->
  <div class="newdigg" id="newdigg">
   <div class="diggbox digg_good" onmousemove="this.style.backgroundPosition='left bottom';" onmouseout="this.style.backgroundPosition='left top';" onclick="javascript:postDigg('good',{dede:field.id/})">
    <div class="digg_act">顶一下</div>
    <div class="digg_num">({dede:field.goodpost/})</div>
    <div class="digg_percent">
     <div class="digg_percent_bar"><span style="width:{dede:field.goodper/}%"></span></div>
     <div class="digg_percent_num">{dede:field.goodper/}%</div>
    </div>
   </div>
   <div class="diggbox digg_bad" onmousemove="this.style.backgroundPosition='right bottom';" onmouseout="this.style.backgroundPosition='right top';" onclick="javascript:postDigg('bad',{dede:field.id/})">
    <div class="digg_act">踩一下</div>
    <div class="digg_num">({dede:field.badpost/})</div>
    <div class="digg_percent">
     <div class="digg_percent_bar"><span style="width:{dede:field.badper/}%"></span></div>
     <div class="digg_percent_num">{dede:field.badper/}%</div>
    </div>
   </div>
  </div>
  <script language="javascript" type="text/javascript">getDigg({dede:field.id/});</script>
  <!-- //顶踩部份的源码结束 -->
评论位置加入调用评论模板代码
 {dede:include file='ajaxfeedback.htm' /} 

另外默认添加上是不正常显示留言窗口的。需要在系统设置里面---其他选项--模板引擎禁用标签吧PHP代码去掉即可


系统默认样式提取
@charset "utf-8";
/* CSS Document */
.mt1{/* ( margin-top * 1 ) */
	margin-top:8px;
}
.tbox{
	margin:0 0 8px 0;
	border-bottom:1px solid #DADADA;
	overflow:hidden;
	background:url(../images/green_skin.png) 0 -294px repeat-x;
}
.tbox dt{
	height:24px;
	border:1px solid #DADADA;
	overflow:hidden;
	clear:both;
}
.tbox dd{
	border-left:1px solid #DADADA;
	border-right:1px solid #DADADA;
	/*padding:4px 4px 0px;*/
	overflow:hidden;
}

.tbox dt strong{
	height:24px;
	line-height:24px; !important;line-height:25px;
	padding-left:8px;
	padding-right:4px;
	display:block;
	float:left;
	color:#316301;
	letter-spacing:1px;
}
.tbox dt strong a{
	color:#316301;
}
.tbox dt strong a:hover{
	color:#596F37;
	text-decoration:none;
}
.tbox dt span.more{
	float:right;
	position:relative;
	line-height:25px;
	padding-right:8px;
	color:#596F37;
}
.tbox dt span.more a{
	color:#596F37;
	text-decoration:none;
}
.tbox dt span.more a:hover{
	color:#ff3333;
	text-decoration:underline;
}
.tbox dt span.label{
	height:25px;
	float:right;
	overflow:hidden;
	padding-right:1px;
	padding-top:2px;
}
.tbox dt span.label a{
	height:26px;
	display:block;
	padding:0px 7px 0px 8px;
	line-height:26px;
	border-left:1px solid #DADADA;
	float:left;
	color:#666;
	text-decoration:none;
	overflow:hidden;
	letter-spacing:1px;
}
.tbox dt span.label a:hover{
	color:#360;
}
.tbox dt span.label a.thisclass{
	background:#FFF;
	color:#333;
	border-top:3px solid #DADADA;
}

.tbox dt span.linklabel{
	float:left;
	margin-left:10px;
	overflow:hidden;
	padding-right:1px;
	padding-top:2px;
}
.tbox dt span.linklabel a{
	height:20px;
	display:block;
	padding:0px 7px 0px 8px;
	margin:0 5px;
	line-height:20px;
	border-left:1px solid #DADADA;
	border-top:1px solid #DADADA;
	border-right:1px solid #DADADA;
	float:left;
	color:#666;
	text-decoration:none;
	overflow:hidden;
	letter-spacing:1px;
}
.tbox dt span.linklabel a:hover{
	color:#360;
}
.tbox dt span.linklabel a.thisclass{
	background:#FFF;
	color:#333;
}
.dede_comment_post{
	padding:5px;
}

.dcmp-stand{
	float:right;
	margin-top:-18px;
	padding-right:10px;
	position:relative;
	clear:both;
	color:#999;
}
.dcmp-stand strong{
	font-weight:normal;
	color:#444;
}
.dcmp-stand input{
	margin-right:2px;
}
.dcmp-stand img{
	vertical-align:middle;
	margin-right:2px;
}
.dcmp-content{
	padding-top:8px;
}
.dcmp-content textarea{
	height:100px;
	width:450px;
	float:left;
}
.clr{
	clear:both;
	}
.ipt-txt{
	line-height:15px;
	padding:4px 5px;
	border-width:1px;
	border-style:solid;
	border-color:#666 #BBB #BBB #666;
	font-size:12px;

}
.dcmp-post{
	height:35px;
	overflow:hidden;
	clear:both;
	color:#444;	
	padding:5px 0 10px 0;
}
.dcmp-post .dcmp-userinfo{
	float:left;
	margin-right:6px;

}
.dcmp-post .dcmp-userinfo input{
	height:13px;
	padding-right:0px;
}
.dcmp-post .dcmp-userinfo input,.dcmp-post .dcmp-userinfo img{
	vertical-align:middle;
	margin:5px;
}
.dcmp-post .dcmp-submit{
	float:left;
	padding-top:6px;
}
.dcmp-post .dcmp-submit input,.dcmp-post .dcmp-submit button{
	vertical-align:middle;
}
.dcmp-post .dcmp-submit button{
	width:70px;
	height:25px;
	border:none;
	background:url(../images/btn-bg2.gif) no-repeat;
	line-height:25px;
	letter-spacing:1px;
	overflow:hidden;
	color:#444;
	cursor:pointer;
	margin-left:5px;

}


/*评论
------------*/
.decmt-box2{
	width:98%;
	padding:6px 5px;
	margin:0px auto;
	overflow:hidden;
	clear:both;
}
.decmt-box2 span.fr{
	float:right;	
	}
.decmt-box2 span.title{
	float:right;
	line-height:20px;
	width:600px;
	}
.decmt-box2 ul{
	}
.decmt-box2 ul li{
	width:100%;
	border-bottom:1px dashed #ccc;
	padding-bottom:10px;
	overflow:hidden;
	}
.decmt-box2 ul li a.plpic{
	float:left;
	width:40px;
	height:40px;
	padding:2px;
	border:1px solid #DFD9B9;
	background:#F9FDED;
	margin-right:5px;
	overflow:hidden;
	}
.decmt-box2 ul li p{
	float:left;
	width:630px;
	line-height:22px;
	}
.decmt-box2 .comment_act{
	float:left;
	width:630px;
	line-height:20px;
	color:#aeaeae;
	}
.decmt-box2 .comment_act a{
	color:#aeaeae;
	}
    
    
.decmt-box{
	width:98%;
	padding:6px 5px;
	margin:0px auto;
	overflow:hidden;
	clear:both;
}
.decmt-box span.fr{
	float:right;	
	}
.decmt-box span.title{
	float:left;
	line-height:20px;
	width:600px;
	}
.decmt-box ul{
	}
.decmt-box ul li{
	width:100%;
	border-bottom:1px dashed #ccc;
	padding-bottom:10px;
	overflow:hidden;
	}
.decmt-box ul li a.plpic{
	float:left;
	width:40px;
	height:40px;
	padding:2px;
	border:1px solid #DFD9B9;
	background:#F9FDED;
	margin-right:5px;
	overflow:hidden;
	}
.decmt-box ul li p{
	float:left;
	width:630px;
	line-height:22px;
	}
.decmt-box .comment_act{
	float:left;
	width:630px;
	line-height:20px;
	color:#aeaeae;
	}
.decmt-box .comment_act a{
	color:#aeaeae;
	}
	
.decmt-box1{
	width:98%;
	padding:6px 5px;
	margin:0px auto;
	overflow:hidden;
	clear:both;
}
.decmt-box1 span.fr{
	float:right;	
	}
.decmt-box1 span.title{
	float:left;
	line-height:20px;
	width:600px;
	}
.decmt-box1 ul{
	}
.decmt-box1 ul li{
	width:100%;
	border-bottom:1px dashed #ccc;
	padding:10px 0;
	overflow:hidden;
	}
.decmt-box1 ul li a.plpic{
	float:left;
	width:40px;
	height:40px;
	padding:2px;
	border:1px solid #DFD9B9;
	background:#F9FDED;
	margin-right:5px;
	overflow:hidden;
	}
.decmt-box1 ul li p{
	float:left;
	width:880px;
	line-height:22px;
	}
.decmt-box1 .comment_act{
	float:left;
	width:880px;
	line-height:20px;
	color:#aeaeae;
	}
.decmt-box1 .comment_act a{
	color:#aeaeae;
	}


.dede_comment .decmt-box .decmt-title{
	line-height:19px;
	color:#999;
	font-family:Tahoma;
}
.dede_comment .decmt-box .decmt-title span{
	margin-right:2px;
	vertical-align:middle;
}
.dede_comment .decmt-box .decmt-title .moodico{
	height:18px;
	width:18px;
	display:inline-block;
}
.dede_comment .decmt-box .decmt-title .username{
	color:#669;
}
.dede_comment .decmt-box .decmt-title .username a{
	color:#669;
}
.dede_comment .decmt-box .decmt-title .username a:hover{
	text-decoration:none;
	color:#690;
}
.dede_comment .decmt-box .decmt-title .ip{
	color:#669;
	font-size:11px;
}
.dede_comment .decmt-box .decmt-title .date{
	color:#555;
	font-size:11px;
}
.dede_comment .decmt-box .decmt-act{
	float:right;
	margin-top:-18px;
	padding-right:10px;
	position:relative;
	clear:both;
	color:#999;
}
.dede_comment .decmt-box .decmt-act span{
	margin-right:7px;
}
.dede_comment .decmt-box .decmt-act span a{
	color:#888;
}
.dede_comment .decmt-box .decmt-content{
	color:#555;
	line-height:21px;
	clear:both;
	width:99%;
	margin:2px auto 0px;
/*	background:url(../images/ico-comment-quote.gif) 0px 4px no-repeat;
	text-indent:18px;*/
}
.dede_comment .decmt-box .decmt-content img{
	vertical-align:middle;
}
.decmt-box,.decmt-content .decmt-box,.dede_comment .decmt-box .decmt-box {
	background:#FFE;
	border:1px solid #CCC;
	margin:6px auto;
}
.dede_comment .decmt-box .decmt-box .decmt-title{
	text-indent:4px;
}
.dede_comment .decmt-box .decmt-box .decmt-content{
	color:#555;
}
.nocomment{
	padding:10px;
	color:#666;
}
.dede_comment_post{
	padding:5px;
}
.dcmp-title{
	line-height:25px;
}
.dcmp-title strong{
	color:#444;
	font-weight:normal;
}
.dcmp-title small{
	font-size:12px;
	color:#999999;
}
.dcmp-stand{

	float:right;
	margin-top:-18px;
	padding-right:10px;
	position:relative;
	clear:both;
	color:#999;
}
.dcmp-stand strong{
	font-weight:normal;
	color:#444;
}
.dcmp-stand input{
	margin-right:2px;
}
.dcmp-stand img{
	vertical-align:middle;
	margin-right:2px;
}
.dcmp-content{
	padding-top:8px;
}
.dcmp-content textarea{
	height:100px;
	width:450px;
	float:left;
}
.dcmp-content1{
	/*width:700px;*/
	padding-top:8px;
}
.dcmp-content1 textarea{
	height:100px;
	width:700px;
	float:left;
}
.dcmp-mood{
	height:25px;
	width:212px;
	margin-top:8px;
	float:right;
}
.dcmp-mood strong{
	float:left;
	color:#444;
	font-weight:normal;
	line-height:25px;
}
.dcmp-mood ul{
	float:left;
}
.dcmp-mood ul li{
	float:left;
	margin-right:8px;
	height:30px;
}
.dcmp-mood ul li input,.dcmp-mood ul li img{
	vertical-align:middle;
	margin-right:4px;
	*margin-right:0px;
}



删除支持--反对--在模板里面删除同时在plus--feedback_ajax.php文件下删除 ;评论内容样式也是这文件更改

转载请注明:DEDEcms» DEDE使用默认评论

标签:
  • DEDE列表页2的倍数判断不同CSS
    135阅读
    {dede:channel type=son typeid=2} [field:global name=autoindex runphp=yes] if(@me%2==0)@me= dd class=\odd\;else @me= dd class=\\;[/field:global] time[field:typen...
  • dede当前位置加样式-当前位置各种写法
    124阅读
    方法一.Dedecms当前位置{dede:field name=position/}方法二.dede:field name=position runphp=yes} $a=mb_strlen(@me);//计算字符串的长度 @me=cn_substr(@me,$a-2,-1);//截取字符 {/dede:field}(...
  • DEDECMS列表页调用当前栏目父级栏目以及链接
    160阅读
    打开文件/include/taglib/channel.lib.php 找到 if($type==top) { $sql = SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From ...
  • 最新百度地图亲测
    289阅读
    style type=text/css html,body{margin:0;padding:0;} .iw_poi_title {color:#CC5522;font-size:14px;font-weight:bold;overflow:hidden;padding-right:13px;white-space:n...
  • 当前栏目三级调用二级、且栏目高亮解决方法
    126阅读
    1、打开 \include\taglib\channelartlist.lib.php 找到$tpsql = reid=$typeid AND ispart2 AND ishidden1 ;改成if($type==son){$typeid = ( !empty($refObj-TypeLink-TypeInfos[id...
  • DEDE自定义表单点击提交后跳转到当前页
    174阅读
    找到/plus/diy.php这个文件修改以下代码将$goto = !empty($cfg_cmspath) ? $cfg_cmspath : /;$bkmsg = 发布成功,现在转向表单列表页...;改为:$goto = !empty($cfg_cmspath) ? $cfg_cmspath : $_SERVER[H...
  • DEDECMS 自定义字段附件只要下载地址
    187阅读
    table width=300 tr td height=30 width=20a href=/uploads/soft/110215/8-6262616262.rar target=_blankimg src=~cfg_phpurl~/img/addon.gif border=0 align=center/a/td ...
  • DedeCMS Error:Tag disabled:"php"的解决办法
    189阅读
    在最新的dedecms5.7版本安装完后会出现这个,其他版本暂时不知。出现的原因是: 官方出于安全考虑默认将{dede:php}{/dede:php}标签禁用了。所以如果页面的模版中使用该标签则会出现这个DedeCMS Error:Tag disabled:php提示。 方法/步骤 1、登录后台找到网站
  • dede自定义字段邮箱邮件发送插件亲测
    242阅读
    网上很多教程都是用dedecms自带的邮件库发送邮件,而且是写死要发送的字段内容,今天我们用phpmailer来给站长发送自定义表单提交的数据到指定邮箱上(QQ邮箱,163邮箱都可以),不写死任何东西,有什么字段就提交发送什么字段。 操作之前,我们要先搞定用来发
  • dede让channelartlist标签支持currentstyle属性顶级不同样式
    154阅读
    打开include\taglib\channelartlist.lib.php 找到 $pv-Fields[typeurl] = GetOneTypeUrlA($typeids[$i]); 在此行代码下方增加以下代码: if($typeids[$i][id] == $refObj-TypeLink-TypeInfos[...
上一页:内容页调用栏目内容方法
下一页:开通会员才可以访问限制代码带CSS
最近更新作品
城市联动提交表单
更新时间:2020-11-17

169人已经看过了!

统计栏目文章数量有的显示数量没有显示0
更新时间:2020-11-15

135人已经看过了!

自定义表单列表添加全选
更新时间:2020-10-19

157人已经看过了!

自定义表单展现样式
更新时间:2020-10-19

165人已经看过了!

Body里面多了个&amp;#65279字符,空白一行解决办法
更新时间:2021-01-25

168人已经看过了!

自定义证书添加图片
更新时间:2020-07-15

235人已经看过了!

dede导出证书查询数据到excel
更新时间:2020-06-19

287人已经看过了!

dedecms--会员信息导出excel表格
更新时间:2020-06-19

171人已经看过了!

dede 获取图集里面图片的数量
更新时间:2020-05-25

176人已经看过了!

织梦栏目做成列表分页(小说列表)
更新时间:2020-05-08

215人已经看过了!